package thread;

public class Test6 {

    public static void main(String[] args)  {
        final Test6 test = new Test6();

        new Thread(){
            public void run() {
                test.get(Thread.currentThread());
            };
        }.start();

        new Thread(){
            public void run() {
                test.get(Thread.currentThread());
            };
        }.start();
    }

    public synchronized void get(Thread thread) {

          for(int i=0;i<3;i++){
            System.out.println(thread.getName()+"正在进行读操作");
          }
        System.out.println(thread.getName()+"读操作完毕");
    }
}
